package joyi.train.domain;

import j.framework.domain.BaseDomain;
import j.util.jdbc.simple.annotation.Column;
import j.util.jdbc.simple.annotation.Table;

/**
 * 用户分类实体类
 * author:jason
 * create time:2015-10-12
 */
@Table(name="cust_CustomerCategory",pkColumns = "categoryId",ukColumns = "parentCategoryId,categoryName")
public class CustomerCategory extends BaseDomain {
    @Override
    public String getId() {
        return categoryId;
    }

    @Override
    public void setId(String id) {
        this.categoryId = id;
    }

    @Column(name="custCategoryId")
    private String categoryId;

    @Column(name="categoryParentId")
    private String parentCategoryId;

    @Column(nullable = false,displayName = "分类名称")
    private String categoryName;//不能为空

    private Integer leftValue;

    private Integer rightValue;

    private String note;

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getParentCategoryId() {
        return parentCategoryId;
    }

    public void setParentCategoryId(String parentCategoryId) {
        this.parentCategoryId = parentCategoryId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Integer getLeftValue() {
        return leftValue;
    }

    public void setLeftValue(Integer leftValue) {
        this.leftValue = leftValue;
    }

    public Integer getRightValue() {
        return rightValue;
    }

    public void setRightValue(Integer rightValue) {
        this.rightValue = rightValue;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CustomerCategory that = (CustomerCategory) o;

        if (categoryId != null ? !categoryId.equals(that.categoryId) : that.categoryId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return categoryId != null ? categoryId.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "CustomerCategory{" +
                "categoryId='" + categoryId + '\'' +
                ", parentCategoryId='" + parentCategoryId + '\'' +
                ", categoryName='" + categoryName + '\'' +
                ", leftValue=" + leftValue +
                ", rightValue=" + rightValue +
                ", note='" + note + '\'' +
                '}';
    }
}
